Skip to content

Cache Detox build derived data in Bitrise CI#211

Merged
gusgard merged 1 commit intoclaude/review-react-native-code-GQS1Tfrom
claude/cache-detox-build-BABoJ
Mar 2, 2026
Merged

Cache Detox build derived data in Bitrise CI#211
gusgard merged 1 commit intoclaude/review-react-native-code-GQS1Tfrom
claude/cache-detox-build-BABoJ

Conversation

@gusgard
Copy link
Owner

@gusgard gusgard commented Mar 2, 2026

Add restore-cache and save-cache steps to cache the xcodebuild derived data directory (example/ios/build/) between CI runs. The cache key is based on Podfile.lock and app.json checksums, with a prefix fallback for partial cache matches. This enables incremental xcodebuild, which should significantly reduce the Detox build step time on cache hits.

https://claude.ai/code/session_01LRLatsmhLdQQgrwnBtJUfr

Add restore-cache and save-cache steps to cache the xcodebuild derived
data directory (example/ios/build/) between CI runs. The cache key is
based on Podfile.lock and app.json checksums, with a prefix fallback
for partial cache matches. This enables incremental xcodebuild, which
should significantly reduce the Detox build step time on cache hits.

https://claude.ai/code/session_01LRLatsmhLdQQgrwnBtJUfr
@gusgard gusgard merged commit c45f9b0 into claude/review-react-native-code-GQS1T Mar 2, 2026
2 checks passed
@gusgard gusgard deleted the claude/cache-detox-build-BABoJ branch March 2, 2026 00:26
gusgard added a commit that referenced this pull request Mar 4, 2026
…196)

* Fix multiple correctness bugs and improve React Native compatibility

- Fix layout.ts: convert static Dimensions.get() to useLayout() hook so
  Pagination dimensions update on orientation changes
- Fix SwiperFlatList.web.ts: replace CommonJS require() with ES import
- Fix viewability config: use viewabilityConfigCallbackPairs consistently
  across all platforms (was missing on web, split between iOS/Android)
- Fix _onViewableItemsChanged: take first changed item instead of looping
  through all items and overwriting state multiple times
- Fix useImperativeHandle race condition: use ref-based scroll enable
  override instead of async state updates that race with scrollToIndex
- Fix autoplay guard: only set timer when autoplay is true, preventing
  wasted setTimeout when autoplayLoop is true but autoplay is false
- Eliminate 300-line code duplication: extract createSwiperFlatList factory
  so WithGestureHandler.tsx reuses all logic from SwiperFlatList.tsx
- Fix missing paginationAccessibilityLabels in WithGestureHandler variant
- Fix colors.ts: use hex value '#808080' instead of non-standard 'gray'
- Update CI workflow to use actions/checkout@v4 and actions/setup-node@v4
- Add react peer dependency, raise minimum react-native to >=0.64.0

https://claude.ai/code/session_01E9LT6HskMaofW2yaTFHd43

* Update yarn install state and lockfile

https://claude.ai/code/session_01E9LT6HskMaofW2yaTFHd43

* Upgrade to React 19 and React Native 0.78

- Update react: 16.8.6 → 19.0.0
- Update react-native: 0.61 → 0.78.0
- Update react-test-renderer: 16.8.6 → 19.0.0
- Update jest: 24.8.0 → 29.7.0
- Update babel-jest: 24.8.0 → 29.7.0
- Update typescript: 4.1.3 → 5.4.0
- Update @types/react: 17.0.0 → 19.0.0
- Update @types/jest: 26.0.19 → 29.5.0
- Replace metro-react-native-babel-preset with @react-native/babel-preset
- Replace react-native-testing-library with @testing-library/react-native
- Remove @types/react-native (bundled since RN 0.73)
- Remove @types/react-test-renderer (included in @types/react 19)
- Update tsconfig lib from es6 to es2020
- Fix React 19 useRef typing (RefObject<T | null>)
- Update peer dependencies: react >= 18.0.0
- Update snapshots for React Native 0.78 render output

https://claude.ai/code/session_01E9LT6HskMaofW2yaTFHd43

* Fix boost checksum mismatch in pod install (#200)

The boost 1.76.0 source archive was re-published with a different
SHA256 checksum, causing pod install to fail verification on Bitrise CI.
Patch the boost podspec at Podfile evaluation time to use the correct
checksum (1c162b5...) instead of the stale one (f0397ba...).

https://claude.ai/code/session_01MuDzCn9Gjq6UB64gy5QnRb

Co-authored-by: Claude <[email protected]>

* Fix yarn install in GitHub Actions by enabling corepack (#199)

Yarn 3 (Berry) requires corepack to be enabled so that the
packageManager field in package.json is respected. Without it,
the system Yarn Classic (1.x) is used, which cannot parse the
Yarn 3 lockfile format.

Also restores the Node.js version matrix (20.x, 22.x) for
broader test coverage across LTS versions.

https://claude.ai/code/session_01WLB7148yUee86GdAebStHj

Co-authored-by: Claude <[email protected]>

* Migrate from Yarn to pnpm (#201)

* Migrate from Yarn to pnpm

Replace Yarn 3.5.0 (Berry) with pnpm 10.29.3 as the package manager for
both the root project and the example folder.

Changes:
- Update packageManager field in root and example package.json
- Replace yarn commands with pnpm in all scripts
- Add eslint-plugin-prettier as explicit devDependency (required by pnpm's
  strict dependency resolution)
- Add pnpm-compatible transformIgnorePatterns for Jest (handles .pnpm
  directory structure)
- Configure pnpm.onlyBuiltDependencies for pre-commit hook support
- Update GitHub Actions CI to use pnpm/action-setup@v4 with caching
- Remove .yarn directory, .yarnrc.yml, and yarn.lock from both root and
  example
- Add pnpm-lock.yaml
- Update CLAUDE.md to reflect pnpm commands

https://claude.ai/code/session_01SUpZUWxrTYoGms6QN3VtQ9

* Remove pre-commit hook and library

- Remove `pre-commit` devDependency and its `spawn-sync` transitive dep
- Remove `"pre-commit"` config section from package.json
- Remove `lint-and-test` script (was only used by pre-commit)
- Remove `pnpm.onlyBuiltDependencies` config (no longer needed)
- Remove git pre-commit hook file
- Update CLAUDE.md to remove pre-commit references

https://claude.ai/code/session_01SUpZUWxrTYoGms6QN3VtQ9

* Run CI on all branches

Remove branch filters from GitHub Actions workflow so CI runs on
all pushes and pull requests, not just master.

https://claude.ai/code/session_01SUpZUWxrTYoGms6QN3VtQ9

---------

Co-authored-by: Claude <[email protected]>

* Migrate Bitrise from deprecated branch-based caching to key-based caching (#202)

Replace deprecated cache-pull@2 and cache-push@2 steps (removal date
2025-04-11) with the recommended key-based caching alternatives:

- android workflow: restore-npm-cache@1 / save-npm-cache@1
- primary workflow: restore-npm-cache@1 + restore-cocoapods-cache@1 /
  save-npm-cache@1 + save-cocoapods-cache@1

The dedicated caching steps automatically configure cache keys and paths,
requiring no additional configuration.

https://claude.ai/code/session_01YJLZcp9TNGeE8mkZueZUcZ

Co-authored-by: Claude <[email protected]>

* ci: use only Node.js 24 in GitHub Actions (#203)

Replace the Node 20.x/22.x matrix with a single Node.js 24.x target.

https://claude.ai/code/session_01G4PnXbfvKUTnQhVbJA1wcw

Co-authored-by: Claude <[email protected]>

* Update Bitrise CI to use pnpm instead of yarn (#204)

Replace yarn@2 steps with script steps that install pnpm globally and
run pnpm install. Replace all yarn detox commands with pnpm equivalents
in both android and primary workflows.

https://claude.ai/code/session_01Vnows3xkpaKpQLhpjs7aNB

Co-authored-by: Claude <[email protected]>

* Upgrade to Node.js 24 and remove all yarn references (#205)

- Add .nvmrc with Node.js 24
- Add nvm@1 step to both Bitrise workflows (android, primary) to use Node.js 24
- Update CLAUDE.md CI section to reflect Node.js 24.x
- Replace yarn with pnpm in README.md installation instructions
- Remove yarn-error.log from .gitignore
- Remove .yarn from .npmignore
- Remove old-rn-example yarn artifacts (.yarn/, yarn.lock, .yarnrc.yml)
- Replace yarn commands with pnpm in old-rn-example/package.json
- Update old-rn-example packageManager to [email protected]

https://claude.ai/code/session_01YLUeA7TbvKaYNiCvT7yzA8

Co-authored-by: Claude <[email protected]>

* Fix iOS pod install failure by hoisting pnpm dependencies (#206)

Add .npmrc with node-linker=hoisted in the example/ directory so that
pnpm installs dependencies in a flat node_modules structure. This is
required because React Native's CocoaPods integration and Expo's
autolinking scripts expect to resolve packages like
expo-modules-autolinking via standard Node.js module resolution, which
fails under pnpm's default strict symlink layout.

https://claude.ai/code/session_01F6dVLQSCFtvczSipghMA9A

Co-authored-by: Claude <[email protected]>

* Upgrade Bitrise to v2: bump format_version, cache steps, and remove Android pipeline (#207)

- Upgrade format_version from 8 to 11
- Upgrade restore-npm-cache and restore-cocoapods-cache from @1 to @2
- Delete the entire Android workflow (android E2E pipeline)
- Remove Android-related env vars (PROJECT_LOCATION, MODULE, VARIANT)

https://claude.ai/code/session_01Ee2Prh2qUvL8SXuNSSSBwJ

Co-authored-by: Claude <[email protected]>

* Reset example app to Expo SDK 55 (React Native 0.83.2, React 19.2) (#208)

- Remove corrupted ios/ and android/ prebuild folders
- Upgrade expo from SDK 48 to SDK 55 (~55.0.2)
- Upgrade react from 18.2.0 to 19.2.0
- Upgrade react-native from 0.71.6 to 0.83.2
- Update expo-status-bar and expo-splash-screen to SDK 55 versions
- Add react-native-gesture-handler (~2.30.0) as explicit dependency
- Add TypeScript and @types/react as devDependencies
- Update @babel/core to ^7.25.0
- Update @config-plugins/detox to ^8.0.0
- Remove npx pod-install from postinstall (no more checked-in ios/)
- Update start script from expo start --dev-client to expo start
- Add ios/ and android/ to .gitignore (prebuild artifacts)

https://claude.ai/code/session_012Yk4iLC1JfG8gtTVXEJLeQ

Co-authored-by: Claude <[email protected]>

* Add expo prebuild step for iOS in Bitrise CI (#209)

Run `expo prebuild --platform ios --clean` after installing dependencies
and before CocoaPods install to generate the native iOS project folder
from the Expo-managed example app.

https://claude.ai/code/session_016YgzHVKAPT5f6yEALTRuRv

Co-authored-by: Claude <[email protected]>

* Fix Detox framework cache error by rebuilding cache before build (#210)

Add a "Detox Build Framework Cache" step to the Bitrise CI workflow that
runs `detox clean-framework-cache && detox build-framework-cache` before
the app build. This ensures the Detox.framework binary is compiled for the
current Xcode version on the CI machine, fixing the DetoxRuntimeError about
a missing framework.

https://claude.ai/code/session_01F9dn58NdcHexYJmnc66hMM

Co-authored-by: Claude <[email protected]>

* Cache Detox build derived data in Bitrise CI (#211)

Add restore-cache and save-cache steps to cache the xcodebuild derived
data directory (example/ios/build/) between CI runs. The cache key is
based on Podfile.lock and app.json checksums, with a prefix fallback
for partial cache matches. This enables incremental xcodebuild, which
should significantly reduce the Detox build step time on cache hits.

https://claude.ai/code/session_01LRLatsmhLdQQgrwnBtJUfr

Co-authored-by: Claude <[email protected]>

* Update Detox iOS simulator from iPhone 14 to iPhone 17 (#212)

Aligns the Detox E2E test device with iPhone 17 for CI runs
on the Xcode 26 stack.

https://claude.ai/code/session_01HMQPcVwyWDjxM3ZB5KDmQe

Co-authored-by: Claude <[email protected]>

* Fix flaky autoplay e2e test by awaiting animation settle (#213)

Replace immediate `expect(...).toBeNotVisible()` assertions with
`waitFor(...).toBeNotVisible().withTimeout(500)` to handle the race
condition where FlatList's paging scroll animation hasn't fully settled
when the non-visibility check runs. Adjacent items can be briefly
partially visible at the screen edge during the scroll animation,
causing the immediate assertion to fail.

https://claude.ai/code/session_01TSf7rodAUegEbivLi1hRY9

Co-authored-by: Claude <[email protected]>

* Post Detox E2E test failures as PR comments on GitHub (#214)

When Detox tests fail on Bitrise, a script now captures the test output
and posts it as a comment on the associated GitHub PR. This lets Claude
Code (or any reviewer) consume the failure details directly from GitHub.

- Add example/scripts/report-detox-failures.sh that posts formatted
  failure output to the PR via the GitHub API
- Update bitrise.yml Detox Test step to capture output with tee and
  invoke the reporting script on failure
- Requires GITHUB_TOKEN secret to be configured in Bitrise

https://claude.ai/code/session_01CfUJmEpVDNXDXfUsih1NMX

Co-authored-by: Claude <[email protected]>

* Fix autoplay timing by stabilizing _scrollToIndex and processing all viewability changes (#215)

Two issues caused unreliable autoplay behavior:

1. _scrollToIndex was recreated on every prevIndex change (via its dependency
   on currentIndexes.index and currentIndexes.prevIndex). Since it was in the
   autoplay useEffect dependency array, this caused unnecessary timer resets
   whenever _onViewableItemsChanged updated prevIndex during scroll animations.
   Fix: use functional state updater so _scrollToIndex has an empty dependency
   array and remains a stable reference.

2. _onViewableItemsChanged only processed the first item in the changed array.
   When FlatList reported multiple viewability changes simultaneously (e.g.,
   one item becoming non-viewable and another becoming viewable), the second
   change was silently dropped. Fix: iterate over all changed items with
   forEach to ensure correct index tracking.

https://claude.ai/code/session_012WFS8zGREtMjNNj9NECCVw

Co-authored-by: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants